Optimal. Leaf size=143 \[ \frac {2 a b \tanh ^{-1}(\sin (c+d x))}{d}-\frac {\left (a^2+3 b^2\right ) \cot (c+d x)}{d}-\frac {\left (2 a^2+3 b^2\right ) \cot ^3(c+d x)}{3 d}-\frac {\left (a^2+b^2\right ) \cot ^5(c+d x)}{5 d}-\frac {2 a b \csc (c+d x)}{d}-\frac {2 a b \csc ^3(c+d x)}{3 d}-\frac {2 a b \csc ^5(c+d x)}{5 d}+\frac {b^2 \tan (c+d x)}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.29, antiderivative size = 143, normalized size of antiderivative = 1.00, number of steps
used = 9, number of rules used = 6, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.286, Rules used = {3957, 2990,
2701, 308, 213, 459} \begin {gather*} -\frac {\left (a^2+b^2\right ) \cot ^5(c+d x)}{5 d}-\frac {\left (2 a^2+3 b^2\right ) \cot ^3(c+d x)}{3 d}-\frac {\left (a^2+3 b^2\right ) \cot (c+d x)}{d}-\frac {2 a b \csc ^5(c+d x)}{5 d}-\frac {2 a b \csc ^3(c+d x)}{3 d}-\frac {2 a b \csc (c+d x)}{d}+\frac {2 a b \tanh ^{-1}(\sin (c+d x))}{d}+\frac {b^2 \tan (c+d x)}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 213
Rule 308
Rule 459
Rule 2701
Rule 2990
Rule 3957
Rubi steps
\begin {align*} \int \csc ^6(c+d x) (a+b \sec (c+d x))^2 \, dx &=\int (-b-a \cos (c+d x))^2 \csc ^6(c+d x) \sec ^2(c+d x) \, dx\\ &=(2 a b) \int \csc ^6(c+d x) \sec (c+d x) \, dx+\int \left (b^2+a^2 \cos ^2(c+d x)\right ) \csc ^6(c+d x) \sec ^2(c+d x) \, dx\\ &=\frac {\text {Subst}\left (\int \frac {\left (1+x^2\right )^2 \left (a^2+b^2+b^2 x^2\right )}{x^6} \, dx,x,\tan (c+d x)\right )}{d}-\frac {(2 a b) \text {Subst}\left (\int \frac {x^6}{-1+x^2} \, dx,x,\csc (c+d x)\right )}{d}\\ &=\frac {\text {Subst}\left (\int \left (b^2+\frac {a^2+b^2}{x^6}+\frac {2 a^2+3 b^2}{x^4}+\frac {a^2+3 b^2}{x^2}\right ) \, dx,x,\tan (c+d x)\right )}{d}-\frac {(2 a b) \text {Subst}\left (\int \left (1+x^2+x^4+\frac {1}{-1+x^2}\right ) \, dx,x,\csc (c+d x)\right )}{d}\\ &=-\frac {\left (a^2+3 b^2\right ) \cot (c+d x)}{d}-\frac {\left (2 a^2+3 b^2\right ) \cot ^3(c+d x)}{3 d}-\frac {\left (a^2+b^2\right ) \cot ^5(c+d x)}{5 d}-\frac {2 a b \csc (c+d x)}{d}-\frac {2 a b \csc ^3(c+d x)}{3 d}-\frac {2 a b \csc ^5(c+d x)}{5 d}+\frac {b^2 \tan (c+d x)}{d}-\frac {(2 a b) \text {Subst}\left (\int \frac {1}{-1+x^2} \, dx,x,\csc (c+d x)\right )}{d}\\ &=\frac {2 a b \tanh ^{-1}(\sin (c+d x))}{d}-\frac {\left (a^2+3 b^2\right ) \cot (c+d x)}{d}-\frac {\left (2 a^2+3 b^2\right ) \cot ^3(c+d x)}{3 d}-\frac {\left (a^2+b^2\right ) \cot ^5(c+d x)}{5 d}-\frac {2 a b \csc (c+d x)}{d}-\frac {2 a b \csc ^3(c+d x)}{3 d}-\frac {2 a b \csc ^5(c+d x)}{5 d}+\frac {b^2 \tan (c+d x)}{d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(368\) vs. \(2(143)=286\).
time = 0.47, size = 368, normalized size = 2.57 \begin {gather*} -\frac {\csc ^7\left (\frac {1}{2} (c+d x)\right ) \sec ^5\left (\frac {1}{2} (c+d x)\right ) \left (40 a^2+196 a b \cos (c+d x)+20 \left (a^2+6 b^2\right ) \cos (2 (c+d x))-130 a b \cos (3 (c+d x))-16 a^2 \cos (4 (c+d x))-96 b^2 \cos (4 (c+d x))+30 a b \cos (5 (c+d x))+4 a^2 \cos (6 (c+d x))+24 b^2 \cos (6 (c+d x))+75 a b \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right ) \sin (2 (c+d x))-75 a b \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right ) \sin (2 (c+d x))-60 a b \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right ) \sin (4 (c+d x))+60 a b \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right ) \sin (4 (c+d x))+15 a b \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right ) \sin (6 (c+d x))-15 a b \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right ) \sin (6 (c+d x))\right )}{7680 d \left (-1+\cot ^2\left (\frac {1}{2} (c+d x)\right )\right )} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.12, size = 154, normalized size = 1.08
method | result | size |
derivativedivides | \(\frac {b^{2} \left (-\frac {1}{5 \sin \left (d x +c \right )^{5} \cos \left (d x +c \right )}-\frac {2}{5 \sin \left (d x +c \right )^{3} \cos \left (d x +c \right )}+\frac {8}{5 \sin \left (d x +c \right ) \cos \left (d x +c \right )}-\frac {16 \cot \left (d x +c \right )}{5}\right )+2 b a \left (-\frac {1}{5 \sin \left (d x +c \right )^{5}}-\frac {1}{3 \sin \left (d x +c \right )^{3}}-\frac {1}{\sin \left (d x +c \right )}+\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )\right )+a^{2} \left (-\frac {8}{15}-\frac {\left (\csc ^{4}\left (d x +c \right )\right )}{5}-\frac {4 \left (\csc ^{2}\left (d x +c \right )\right )}{15}\right ) \cot \left (d x +c \right )}{d}\) | \(154\) |
default | \(\frac {b^{2} \left (-\frac {1}{5 \sin \left (d x +c \right )^{5} \cos \left (d x +c \right )}-\frac {2}{5 \sin \left (d x +c \right )^{3} \cos \left (d x +c \right )}+\frac {8}{5 \sin \left (d x +c \right ) \cos \left (d x +c \right )}-\frac {16 \cot \left (d x +c \right )}{5}\right )+2 b a \left (-\frac {1}{5 \sin \left (d x +c \right )^{5}}-\frac {1}{3 \sin \left (d x +c \right )^{3}}-\frac {1}{\sin \left (d x +c \right )}+\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )\right )+a^{2} \left (-\frac {8}{15}-\frac {\left (\csc ^{4}\left (d x +c \right )\right )}{5}-\frac {4 \left (\csc ^{2}\left (d x +c \right )\right )}{15}\right ) \cot \left (d x +c \right )}{d}\) | \(154\) |
risch | \(-\frac {4 i \left (15 a b \,{\mathrm e}^{11 i \left (d x +c \right )}-65 a b \,{\mathrm e}^{9 i \left (d x +c \right )}+98 b a \,{\mathrm e}^{7 i \left (d x +c \right )}+40 a^{2} {\mathrm e}^{6 i \left (d x +c \right )}+98 b a \,{\mathrm e}^{5 i \left (d x +c \right )}+20 a^{2} {\mathrm e}^{4 i \left (d x +c \right )}+120 b^{2} {\mathrm e}^{4 i \left (d x +c \right )}-65 a b \,{\mathrm e}^{3 i \left (d x +c \right )}-16 a^{2} {\mathrm e}^{2 i \left (d x +c \right )}-96 b^{2} {\mathrm e}^{2 i \left (d x +c \right )}+15 b a \,{\mathrm e}^{i \left (d x +c \right )}+4 a^{2}+24 b^{2}\right )}{15 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right ) \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{5}}-\frac {2 b a \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{d}+\frac {2 b a \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{d}\) | \(233\) |
norman | \(\frac {\frac {a^{2}+2 b a +b^{2}}{160 d}-\frac {5 \left (a^{2}+7 b^{2}\right ) \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{8 d}+\frac {\left (a^{2}-2 b a +b^{2}\right ) \left (\tan ^{12}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{160 d}+\frac {\left (11 a^{2}-32 b a +21 b^{2}\right ) \left (\tan ^{10}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{240 d}+\frac {\left (11 a^{2}+32 b a +21 b^{2}\right ) \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{240 d}+\frac {\left (25 a^{2}-118 b a +105 b^{2}\right ) \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{96 d}+\frac {\left (25 a^{2}+118 b a +105 b^{2}\right ) \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{96 d}}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5} \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}-\frac {2 b a \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{d}+\frac {2 b a \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{d}\) | \(260\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.27, size = 143, normalized size = 1.00 \begin {gather*} -\frac {a b {\left (\frac {2 \, {\left (15 \, \sin \left (d x + c\right )^{4} + 5 \, \sin \left (d x + c\right )^{2} + 3\right )}}{\sin \left (d x + c\right )^{5}} - 15 \, \log \left (\sin \left (d x + c\right ) + 1\right ) + 15 \, \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 3 \, b^{2} {\left (\frac {15 \, \tan \left (d x + c\right )^{4} + 5 \, \tan \left (d x + c\right )^{2} + 1}{\tan \left (d x + c\right )^{5}} - 5 \, \tan \left (d x + c\right )\right )} + \frac {{\left (15 \, \tan \left (d x + c\right )^{4} + 10 \, \tan \left (d x + c\right )^{2} + 3\right )} a^{2}}{\tan \left (d x + c\right )^{5}}}{15 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 3.90, size = 241, normalized size = 1.69 \begin {gather*} -\frac {30 \, a b \cos \left (d x + c\right )^{5} + 8 \, {\left (a^{2} + 6 \, b^{2}\right )} \cos \left (d x + c\right )^{6} - 70 \, a b \cos \left (d x + c\right )^{3} - 20 \, {\left (a^{2} + 6 \, b^{2}\right )} \cos \left (d x + c\right )^{4} + 46 \, a b \cos \left (d x + c\right ) + 15 \, {\left (a^{2} + 6 \, b^{2}\right )} \cos \left (d x + c\right )^{2} - 15 \, {\left (a b \cos \left (d x + c\right )^{5} - 2 \, a b \cos \left (d x + c\right )^{3} + a b \cos \left (d x + c\right )\right )} \log \left (\sin \left (d x + c\right ) + 1\right ) \sin \left (d x + c\right ) + 15 \, {\left (a b \cos \left (d x + c\right )^{5} - 2 \, a b \cos \left (d x + c\right )^{3} + a b \cos \left (d x + c\right )\right )} \log \left (-\sin \left (d x + c\right ) + 1\right ) \sin \left (d x + c\right ) - 15 \, b^{2}}{15 \, {\left (d \cos \left (d x + c\right )^{5} - 2 \, d \cos \left (d x + c\right )^{3} + d \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 326 vs.
\(2 (135) = 270\).
time = 0.54, size = 326, normalized size = 2.28 \begin {gather*} \frac {3 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 6 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 3 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 25 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 70 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 45 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 960 \, a b \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 960 \, a b \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) + 150 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 660 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 570 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \frac {960 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1} - \frac {150 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 660 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 570 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 25 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 70 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 45 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 3 \, a^{2} + 6 \, a b + 3 \, b^{2}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5}}}{480 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 1.04, size = 248, normalized size = 1.73 \begin {gather*} \frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5\,{\left (a-b\right )}^2}{160\,d}+\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (\frac {a^2}{32}-\frac {5\,a\,b}{48}+\frac {7\,b^2}{96}+\frac {{\left (a-b\right )}^2}{48}\right )}{d}-\frac {\frac {2\,a\,b}{5}+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (\frac {22\,a^2}{15}+\frac {64\,a\,b}{15}+\frac {14\,b^2}{5}\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6\,\left (10\,a^2+44\,a\,b+102\,b^2\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,\left (\frac {25\,a^2}{3}+\frac {118\,a\,b}{3}+35\,b^2\right )+\frac {a^2}{5}+\frac {b^2}{5}}{d\,\left (32\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5-32\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7\right )}+\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (\frac {7\,a^2}{32}-\frac {19\,a\,b}{16}+\frac {35\,b^2}{32}+\frac {3\,{\left (a-b\right )}^2}{32}\right )}{d}+\frac {4\,a\,b\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________